package day05;

import java.util.Scanner;

public class Addition {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int sum = 0;
        System.out.println("准备算术");
        for (int i =1;i<=10;i++){
            int a = (int) (Math.random()*100);
            int b = (int) (Math.random()*100);
            System.out.println("("+i+")"+a+"+"+b+"="+"?");
            int c = scanner.nextInt();
            if (c == a+b){
                System.out.println("恭喜你，答对了");
                sum += 10;
            }else {
                System.out.println("很遗憾，你答错了");
            }
        }
        System.out.println("答题结束，你的分数为"+sum+"分");
    }
}
